<template>
  <div class="container">
    <div class="list">
      <div v-for="item in list" :key="item.id" class="item">
        <img class="img" :src="item.image|imgPath" alt>
        <div class="info">
          <div class="name">{{item.realname}}</div>
          <div class="extra">{{item.createTime||"2018-04-13 15:21:26"}}</div>
        </div>
        <router-link :to="`/great-man/detail/${item.id}`">
          <van-button class="btn" type="danger">查看详情</van-button>
        </router-link>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      list: []
    }
  },
  created () {
    this.getList()
  },
  methods: {
    getList () {
      this.$axios.get('/xbkj-dj/web/showuser/list').then(res => {
        this.list = res.data
      })
    }
  }
}
</script>
<style lang="less" scoped>
.container {
  padding: 20px;
}
.list {
  background-color: #fff;
  border-radius: 4px;
  .item {
    display: flex;
    align-items: center;
    padding: 20px 10px;
    .img {
      flex: 0 0 45px;
      display: block;
      width: 45px;
      height: 60px;
      margin-right: 10px;
      border-radius: 4px;
    }
    .info {
      flex: 1;
      display: flex;
      height: 50px;
      flex-direction: column;
      justify-content: space-between;
      .name {
        font-weight: bold;
      }
      .extra {
        font-size: 12px;
        color: #999;
      }
    }
    .btn {
      height: 30px;
      line-height: 30px;
      border-radius: 4px;
    }
  }
}
</style>
